<template>
    <div class="person">
        <h2>ref定义基本类型的响应式数据</h2>
        <p>姓名：{{ name }}</p>
        <p>年龄：{{ age }}</p>
        <button @click="changeAge">年龄+1</button>
    </div>
</template>

<script lang="ts" setup name="Person">
import { ref} from 'vue';
let name=ref('张三');
let age=ref(18);

function changeAge(){
    age.value++;
    console.log('age=',age);
}
</script>

<style lang="css" scoped>
</style>